
# 函数返回多个值
# def test():
#     return 1,2,"Hello",True
#
# x,y,z,a = test()
# print(x,y,z,a)





# 缺省参数(默认值)

# def test(name,age = 12,gender = "男"): # gener有默认值，不传参时，为默认值  默认值必须要设置到最后一个如果age设置了，那么gender也要设置
#     print(name,age,gender)
#
# test("小明")
# test("小爱",15,"女")




# 不定长-位置 *
# def test1(*args):
#     print(args)
#     print(type(args))
#
# test1(1, 2, 3,"xiaoming")
#
# # 不定长-关键字 **
# def test2(**kwargs):
#     print(kwargs)
#     print(type(kwargs))
#
# test2(a=1, b=2, c=3,name="xiaoming")






# lambda匿名函数

# def test(add):
#     ret = add(1,2)
#     print(ret)
#
# test(lambda x,y:x + y)